package thread;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;

public class SleepDemo {//睡眠阻塞
    public static void main(String[] args) throws IOException {
        /*Scanner scanner =new Scanner(System.in);
        System.out.println("请输入一个时间");
        int time = scanner.nextInt();
        System.out.println("倒计时"+time+"秒");


        for (int i = time; i>0; i--) {
            System.out.println(time);
        }*/

        BufferedReader br =new BufferedReader(
                new InputStreamReader(
                        System.in
                )
        );
        String line =br.readLine();
        int time =Integer.parseInt(line);

        try {
            Thread.sleep(1000);//剩最后一秒时输出语句
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("倒计时结束");
    }
}
